package com.pj.fantabestconsole.client;

import com.extjs.gxt.ui.client.GXT;
import com.extjs.gxt.ui.client.Registry;
import com.extjs.gxt.ui.client.mvc.Dispatcher;
import com.extjs.gxt.ui.client.util.Theme;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.pj.fantabestconsole.client.mvc.ConsoleController;

public class FantaBestConsole implements EntryPoint {
	
	
	/**
	 * The message displayed to the user when the server cannot be reached or
	 * returns an error.
	 */
	private static final String SERVER_ERROR = "An error occurred while "
			+ "attempting to contact the server. Please check your network "
			+ "connection and try again.";


	/**
	 * This is the entry point method.
	 */
	public void onModuleLoad() {
		GXT.setDefaultTheme(Theme.BLUE, true);
		FantaBestConsoleConstants constants = (FantaBestConsoleConstants)GWT.create(FantaBestConsoleConstants.class);
		Registry.register(ConsoleRegistryKeys.CONSTANTS, constants);
		
		FantaBestConsoleMessages messages = (FantaBestConsoleMessages)GWT.create(FantaBestConsoleMessages.class);
		Registry.register(ConsoleRegistryKeys.MESSAGES, messages);

//		Registro i servizi

		
//		Aggiungo i controller al dispatcher
	    Dispatcher dispatcher = Dispatcher.get();
	    dispatcher.addController(new ConsoleController());
	    
	    dispatcher.dispatch(ConsoleEvents.Init);
		
	}

}
